package com.neusoft.elmboot.mapper;

import com.neusoft.elmboot.po.Comment;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CommentMapper {

    @Select("select * from comments where businessId=#{businessId} order by id")
    public List<Comment> listCommentByBusinessId(Integer businessId);

    @Insert("insert into comments(id,userId,businessId,content) values(#{id},#{userId},#{businessId},#{content})")
    public int saveComment(Comment comment);

    @Update("update comments set content=#{content} where id=#{id}")
    public int updateComment(Comment comment);

    @Delete("delete from comments where id=#{id}")
    public int removeComment(Comment comment);
}
